algorithm to check whether the given number is positive or negative